(function(cjs, as){
	var p; // shortcut to reference prototypes
	//Switch
	(as.Switch=function(){
		this.Container_constructor();
		this._uncheck_color='rgba(0,0,0,0.25)';
		this._p=9;
		this._check=false;
		this._curr_x=(this._p+2)*3;
		
		var shape=new cjs.Shape();
		shape.parent=this;
		this.addChild(shape);
		
		this.reset=function(){
			this._uncheck_color=this._check?'#1890ff':'rgba(0,0,0,0.25)';
			this._curr_x=this._check?(this._p+2):(this._p+2)*3;
			
			shape.graphics.clear();
			shape.graphics.beginFill(this._uncheck_color);
			shape.graphics.drawRoundRect(0,0,(this._p+2)*4,(this._p+2)*2,this._p+2);
			
			shape.graphics.beginFill('#ffffff');
			shape.graphics.drawCircle(this._curr_x,this._p+2,this._p);
		};
		this.reset();
		//事件
		this.on('click',function(){
			var evt=new cjs.Event('change');
			evt.data={check:!this._check};
			this.dispatchEvent(evt);
		},null,false);
		this.mouseChildren=false;
	});
	p=cjs.extend(as.Switch,cjs.Container);
	p._get_width=function(){
		return (this._p+2)*4;
	};
	p._set_width=function(value){
		this._p=value/4-2;
		this.reset();
	};
	try {
		Object.defineProperties(p, {
			width: { get: p._get_width, set: p._set_width }
		});
	} catch (e) {}
	p._get_size=function(){
		return this._p;
	};
	p._set_size=function(value){
		this._p=value;
		this.reset();
	};
	try {
		Object.defineProperties(p, {
			size: { get: p._get_size, set: p._set_size }
		});
	} catch (e) {}
	p._get_check=function(){
		return this._check;
	};
	p._set_check=function(value){
		this._check=value;
		this.reset();
	};
	try{
		Object.defineProperties(p,{
			check:{get:p._get_check,set:p._set_check}
		});
	}catch(e){}
	as.Switch = cjs.promote(as.Switch, "Container");
	
})(createjs = createjs||{}, ascainiao = ascainiao||{});
var createjs, ascainiao;